<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2018~2018 GoMaoMao [ http://www.gomaomao.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.gomaomao.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | 联系方式：GoMaoMao <vip.vvm@qq.com>
// +----------------------------------------------------------------------
// | github开源项目：https://gitee.com/gomaomao.com/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\miniprogram\controller\api;

use controller\BasicApi;

class Content extends BasicApi
{
	public $table = 'document';

	function _index_before(&$param)
	{
		$param['fields']  = 'id,cate_id,cover,update_at,title';
		if (!empty($param['cate_id'])) {
			$param['where'][] = ['cate_id', '=', $param['cate_id']];
		}
		$param['order'] = 'sort asc, id desc';
	}


	function _read_after(&$vo){
		$vo['update_time'] = date('Y-m-d H:i',$vo['update_at']);
	}
}